﻿Public Class Console_Example1
    Public Shared Sub MainConsole_Example1()
        Console.Write("Hello ")
        Console.WriteLine("World!")
        Console.Write("Enter your name: ")
        Dim name As String = Console.ReadLine()
        Console.Write("Good day, ")
        Console.Write(name)
        Console.WriteLine("!")
    End Sub
End Class
' The example displays output similar to the following: 
'        Hello World! 
'        Enter your name: James 
'        Good day, James!

Module Console_Example2
    Public Sub Main_Console_Example2()
        ' Create a Char array for the modern Cyrillic alphabet,  
        ' from U+0410 to U+044F. 
        Dim nChars As Integer = &H44F - &H410
        Dim chars(nChars) As Char
        Dim codePoint As UInt16 = &H410
        For ctr As Integer = 0 To chars.Length - 1
            chars(ctr) = ChrW(codePoint)
            codePoint += CType(1, UShort)
        Next

        Console.WriteLine("Current code page: {0}",
                          Console.OutputEncoding.CodePage)
        Console.WriteLine()
        ' Display the characters. 
        For Each ch In chars
            Console.Write("{0}  ", ch)
            If Console.CursorLeft >= 70 Then Console.WriteLine()
        Next
    End Sub
End Module
' The example displays the following output: 
'       Current code page: 437 
'        
'       ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? 
'       ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? 
'       ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?